Conventionally, there has been an information processing system in which an input is performed by an operation of moving an input device. For example, in a conventional game system, a camera is provided in a controller held by a user, and an image of a marker arranged in the vicinity of a television is captured by the camera. The game system calculates a two-dimensional vector based on the image captured by the camera, and moves an operation target displayed on the monitor based on the two-dimensional vector.
In the method of capturing an image of a marker with a camera, however, a user can move the input device only in a range where the marker is included in the imaging range (field-of-view range) of the camera, and thus the range where the user can move the input device is limited.
Therefore, the present application discloses a storage medium having stored thereon an information processing program, an information processing system, an information processing apparatus, and a method of calculating a designated position, which can improve the operability of an input operation of moving an input member.
(1)
An example of a storage medium according to the present specification is a non-transitory computer-readable storage medium having stored therein an information processing program to be executed by a computer of an information processing apparatus for calculating a designated position based on an input provided to an input member. The information processing program causes the computer to execute: calculating a first position; calculating a second position; making a determination; and calculating a designated position.
The computer calculates a first position using imaging information based on an image captured by an imaging device that is provided in the input member or captures the input member, the first position being a position on a predetermined plane and changing in accordance at least with an attitude of the input member.
The computer calculates a second position using a detection result of a sensor, the detection result enabling a calculation of the attitude of the input member, the second position being a position on the plane and according to the attitude of the input member.
The computer repeatedly determines whether or not a predetermined condition is satisfied, the predetermined condition including a condition regarding a relationship between the first position and the second position.
The computer calculates a designated position on the plane using the first position and/or the second position.
Further, the computer, in a satisfaction period after the predetermined condition has been satisfied, calculates the designated position by making an influence of the second position relatively great as compared to an unsatisfaction period before the predetermined condition is satisfied.
The above “input member” may be an input device separated from the information processing apparatus, or may be integrated with the information processing apparatus.
Based on the above configuration (1), the designated position is calculated using the first position calculated from the imaging information, together with the second position calculated from the detection result of the sensor. Thus, for example, the designated position is calculated using the second position even when the first position is not calculated from the imaging information. Thus, a user can perform an input operation using the input member even when the input member is in an attitude that does not enable the calculation of the first position. This enables the user to perform an input operation by moving the input member more freely, and therefore makes it possible to improve the operability of the input operation of moving the input member.
In addition, based on the above configuration (1), in the unsatisfaction period, the designated position is calculated by making the influence of the first position relatively great. That is, at an early stage where the calculation of the designated position has been started, the influence of the first position may be made relatively great, whereby it is possible to improve the accuracy of the designated position.
(2)
The predetermined condition may include a condition regarding a distance between the first position and the second position.
Based on the above configuration (2), the use of the above distance makes it possible to easily determine whether or not, as a value according to the attitude of the input member, the second position has been calculated with as high accuracy as the first position. This makes it possible to easily determine the switching from the unsatisfaction period to the satisfaction period.
(3)
The condition regarding the distance may be a condition that the distance between the first position and the second position becomes equal to or smaller than a predetermined value.
Based on the above configuration (3), the switching from the unsatisfaction period to the satisfaction period is performed at timing when the difference between the first position and the second position is small. The switching may be performed at such timing, whereby it is possible to reduce the possibility that the designated position based on these positions rapidly changes before and after the switching. This reduces the possibility of giving the user discomfort when the switching is performed. This makes it possible to improve the operability of the input operation.
(4)
The computer may repeatedly determine whether or not a sub-condition regarding the relationship between the first position and the second position is satisfied. In this case, when the sub-condition is satisfied predetermined multiple times, the computer may determine that the predetermined condition is satisfied.
Based on the above configuration (4), even when the sub-condition has been accidentally satisfied only once, it is possible to prevent the switching from the unsatisfaction period to the satisfaction period. This makes it possible to improve the accuracy of the timing of the switching, and therefore possible to improve the operability of the input member.
(5)
The computer may repeatedly determine whether or not a sub-condition regarding the relationship between the first position and the second position is satisfied. In this case, when the sub-condition has been satisfied a predetermined number of times in succession, the computer may determine that the predetermined condition is satisfied.
Based on the above configuration (5), when the sub-condition has been satisfied a predetermined number of times in succession, the switching from the unsatisfaction period to the satisfaction period is performed. This makes it possible to further reduce the possibility that the designated position is calculated using the second position having low accuracy, and therefore possible to calculate the designated position with higher accuracy.
(6)
The predetermined condition may include a condition regarding a reliability of the detection result of the sensor.
Based on the above configuration (6), when the second position calculated from the detection result of the sensor has high accuracy, it is possible to calculate the designated position by increasing the degree of influence of the second position. This makes it possible to improve the accuracy of the calculation of the designated position, and therefore possible to improve the accuracy of the input operation.
(7)
The condition regarding the reliability may be a condition that a motion of the input member is gentler than a predetermined reference.
Based on the above configuration (7), the use of the intensity of the motion of the input member makes it possible to determine the reliability with high accuracy.
(8)
In the unsatisfaction period, the designated position may be calculated using the first position, and in the satisfaction period, the designated position may be calculated using the second position.
Based on the above configuration (8), in an early period in which the second position has low accuracy based on a guess, the designated position is calculated using the first position, which has relatively high accuracy based on a guess. Thus, it is possible to enable the input operation with high accuracy, and therefore possible to improve the operability of the input operation.
(9)
In the unsatisfaction period, the designated position may be calculated using the first position and without using the second position, and in the satisfaction period, the designated position may be calculated using the first position and the second position.
Based on the above configuration (9), in an early period in which the second position may have low accuracy, the use of only the first position makes it possible to calculate the designated position with high accuracy. In the satisfaction period, the use of two types of positions makes it possible to calculate the designated position with high accuracy.
(10)
The second position may be calculated based on the detection result of the sensor, and the calculated second position may be corrected by bringing the calculated second position close to the first position. In this case, it may be determined, using the corrected second position, whether or not the predetermined condition is satisfied. The designated position may be calculated using the corrected second position.
Based on the above configuration (10), it is possible to reduce the increase in the difference between the first position and the second position. Thus, it is possible to reduce the possibility that the designated position calculated based on these positions rapidly changes before and after the switching from the unsatisfaction period the satisfaction period. This reduces the possibility of giving the user discomfort when the switching is performed. This makes it possible to improve the operability of the input operation.
Further, when the above configuration (10) is combined with the above configuration (2) or (3), it is possible to make it likely that the first position and the second position come close to each other. This makes it likely that the timing at which the switching to the satisfaction period is performed is early. This enables the user to start earlier the input operation that allows the user to move the input member freely, and makes it possible to improve the operability of the input operation.
(11)
The first position and the second position before being corrected may be repeatedly calculated. In this case, every time the first position and the second position before being corrected are calculated, an amount of correction may be calculated in accordance with a difference between the first position and the second position before being corrected, and the second position before being corrected may be corrected by bringing the second position before being corrected close to the first position by the amount of correction.
Based on the above configuration (11), the use of the amount of correction based on the above difference makes it possible to easily make a correction to bring the second position before being corrected close to the first position.
(12)
If the second position is calculated when the first position is not calculated, the second position that has been currently calculated may be corrected using the amount of correction that has been calculated last.
Based on the above configuration (12), even when the first position is not calculated, the second position is corrected. Based on this, the second position is corrected regardless of whether or not the first position can be calculated. This makes it possible to prevent the second position from changing in accordance with whether or not the first position can be calculated. This makes it possible to reduce the possibility of giving the user discomfort, and therefore possible to improve the operability of the input operation.
(13)
The first position may be calculated using the imaging information obtained at predetermined timing. In this case, the second position may be calculated using the detection result of the sensor obtained at the same timing as the imaging information.
Based on the above configuration (13), it is possible to calculate two types of positions (the first position and the second position) based on the attitude of the input member so as to correspond to the attitude of the input member at substantially the same point in time. This makes it possible to calculate the designated position with high accuracy.
(14)
When the imaging device can capture a predetermined imaging target, the first position may be calculated based on a position of the imaging target in an image captured by the imaging device. In this case, the second position may be calculated based on the detection result of the sensor when the input member is in any attitude.
Based on the above configuration (14), the use of the imaging information makes it possible to calculate the designated position with high accuracy, and the use of the detection result of the sensor makes it possible to enable the input operation even when the first position is not calculated using the imaging information.
It is noted that the present specification discloses an information processing apparatus and an information processing system that execute processing equivalent to that achieved by executing the information processing program according to the above configurations (1) to (14). Further, the present specification discloses a method of calculating a designated position, the method performed in the above configurations (1) to (14).
In addition, an example of an information processing apparatus according to the present specification calculates a designated position on a predetermined plane based on an input provided to an input member. The information processing apparatus includes a first position calculation section, a second position calculation section, a determination section, and a designated position calculation section. The first position calculation section calculates a first position using imaging information based on an image captured by a camera that is provided in the input member or a camera that captures the input member, the first position being a position on the plane and changing in accordance at least with an attitude of the input member. The second position calculation section calculates a second position using a detection result of at least one of a gyro sensor, an acceleration sensor, and a magnetic sensor, the second position being a position on the plane on which the first position is calculated and according to the attitude of the input member. The determination section repeatedly determines whether or not a predetermined condition is satisfied, the predetermined condition including a condition that a distance between the first position and the second position is equal to or smaller than a predetermined distance continuously for a predetermined period. The designated position calculation section, when the predetermined condition is not satisfied, calculates a designated position on the plane using the first position and without using the second position, and after the predetermined condition has been satisfied, calculates the designated position on the plane using the second position.
Based on the storage medium having stored therein the information processing program, the information processing apparatus, the information processing system, and the method of calculating a designated position, it is possible to improve the operability of an input operation of moving an input member, by appropriately using a first position based on imaging information and a second position based on a detection result of a sensor.
These and other objects, features, aspects and advantages of the exemplary embodiments will become more apparent from the following detailed description of the exemplary embodiments when taken in conjunction with the accompanying drawings.